const Home = () => import('@/views/Home/index.vue')
const Layout = () => import('@/views/Layout/index.vue')
const Login = () => import('@/views/Login/index.vue')
const Category = () => import('@/views/Category/index.vue')
const SubCategory = () => import('@/views/SubCategory/index.vue')
const Detail = () => import('@/views/Detail/index.vue')

export const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        component: Home
      },
      {
        path: 'category/:id',
        component: Category
      },
      {
        path: 'category/sub/:id',
        component: SubCategory
      },
      {
        path: 'detail/:id',
        component: Detail
      },
      {
        path: 'cartlist',
        component: () => import('@/views/CartList/index.vue')
      },
      {
        path: 'checkout',
        component: () => import('@/views/Checkout/index.vue')
      },
      {
        path: 'pay',
        component: () => import('@/views/pay/index.vue')
      },
      {
        path: 'payback',
        component: () => import('@/views/pay/PayBack.vue')
      },
      {
        path: 'member',
        component: () => import('@/views/Member/index.vue'),
        children: [
          {
            path: '',
            component: () => import('@/views/Member/components/user/index.vue')
          },
          {
            path: 'order',
            component: () => import('@/views/Member/components/order/index.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/login',
    component: Login
  }
]
